home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1988 December / 1988-12.d64 / double take (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  6KB  |  176 lines

  1. 10 rem copyright 1988 compute! publications, inc. - all rights reserved
  2. 20 poke646,0:poke53280,15:poke53281,15:print"[147]";tab(11)"copyright 1988"
  3. 25 printtab(6)"compute! publications, inc."
  4. 30 printtab(9)"all rights reserved"
  5. 40 fori=1to9:reada$:next:fori=1to380:reada:x=x+a:next
  6. 50 ifx<>14781thenprint"error in data statement.":stop
  7. 60 restore:goto130
  8. 70 gosub1740:print"[144]"spc(14)"it's a draw":goto90
  9. 80 gosub1740:poke646,cl(pl):print""spc(8)"player"pl+1"[157] is the winner"
  10. 90 poke646,i:print""spc(8)"press firebutton to play"
  11. 100 i=i+1:ifi>=15theni=0
  12. 110 jb=16-peek(56320)and16:ifjb=0thenrun
  13. 120 goto90
  14. 130 gosub1740:print"[147]";:poke53280,15:poke53281,15:poke53289,5
  15. 140 printspc(13)"[144][176][201][157][157][194][194]ouble [145][195][178][195][195][195]":printspc(13)"[173][203]     [145]  [194]ake"
  16. 150 printspc(22)"[173]":print""spc(12)"1[146] or 2[146] joysticks":c$=""
  17. 160 poke198,0:wait198,1:getc$:ifc$<"1"orc$>"2"then160
  18. 170 f2=val(c$)-1
  19. 180 printspc(10)"[145]p l e a s e  w a i t"
  20. 190 dimdu(25),b(2,25),fl(2,25),a$(2,25),an(2,25),zz(25),bb(25,4),bc(2,30)
  21. 200 cr$="tu[157][157]vw":dn=189:up=93:lm=45:rm=126
  22. 210 fori=1to9:readte$(i):next
  23. 220 fori=1to25:bc(1,i)=2:bc(2,i)=2:next
  24. 230 tv=53248:poketv+21,4:poke2042,11:fori=0to62:readq:poke704+i,q:next
  25. 240 ml$="[162]"+chr$(8)+"[189]<"+chr$(3)+"[149]x[202]"+chr$(16)+chr$(248)+"l[191][163]":poke835,0
  26. 250 poke53272,peek(53272)and240or12
  27. 260 poke836,208:poke830,0:poke831,216:poke828,0:poke829,56:poke56334,0
  28. 270 poke1,51:ml$=ml$:sys(peek(51)+256*peek(52)):poke1,55:poke56334,1
  29. 280 fori=13312to13503:readj:pokei,j:next
  30. 290 fori=1to25:readzz(i):next
  31. 300 fori=1to25:forx=1to4:readbb(i,x):next:next
  32. 310 forq=1to2:fori=1to25:dummy(i)=1:next:fori=1to25
  33. 320 x=int(25*rnd(1))+1:ifdummy(x)=0then320
  34. 330 b(q,i)=x:dummy(x)=0:next
  35. 340 fori=1to25:ifb(q,i)<10thena$(q,i)=te$(b(q,i)):goto360
  36. 350 a$(q,i)=right$(str$(b(q,i)),2)
  37. 360 nexti,q
  38. 370 fori=1to25:an(1,i)=b(1,i):forz=1to25
  39. 380 ifb(2,z)=an(1,i)thenan(2,i)=z:z=25:nextz,i:goto400
  40. 390 nextz
  41. 400 print"[155]";:a=1:b=5
  42. 410 fori=1to5:forw=atob
  43. 420 print""a$(1,w);:next:print"";
  44. 430 forw=atob:print""a$(2,w);:next:print""
  45. 440 a=a+5:b=b+5:print"";:nexti
  46. 450 poke53280,11:poke53281,11:cl(0)=14:cl(1)=7
  47. 460 print"[144]"
  48. 470 print"  [176][195][195][178][195][195][178][195][195][178][195][195][178][195][195][174]    [176][195][195][178][195][195][178][195][195][178][195][195][178][195][195][174]"
  49. 480 print"  [194][194][194][194][194][194][194][194][194][194][194][194]"
  50. 490 print"  [194][194][194][194][194][194][194][194][194][194][194][194]"
  51. 500 fori=1to4:print"  [171][195][195][219][195][195][219][195][195][219][195][195][219][195][195][179]    [171][195][195][219][195][195][219][195][195][219][195][195][219][195][195][179]"
  52. 510 print"  [194][194][194][194][194][194][194][194][194][194][194][194]"
  53. 520 print"  [194][194][194][194][194][194][194][194][194][194][194][194]":next
  54. 530 print"  [173][195][195][177][195][195][177][195][195][177][195][195][177][195][195][189]    [173][195][195][177][195][195][177][195][195][177][195][195][177][195][195][189]";
  55. 540 qx=95:qy=45:mt=1:gosub1020
  56. 550 poketv+4,qy:poketv+5,qx:poke53271,peek(53271)or(2^2)
  57. 560 poke53289,cl(pl):gosub890
  58. 570 ifbc(1,mt)<>2thenpoke53280,cl(pl):fori=1to1000:next:poke53280,11:goto560
  59. 580 poke646,cl(pl):uv=mt
  60. 590 p=mt:y1=5:gosub810:printcr$:bc(1,mt)=pl:mm=mt:xr=r1
  61. 600 ifbb(mt,1)=0then620
  62. 610 ifbc(1,bb(mt,1))=-pl+1andbc(1,bb(mt,2))=-pl+1then y1=5:goto650
  63. 620 ifbb(mt,3)=0then690
  64. 630 ifbc(1,bb(mt,3))=-pl+1andbc(1,bb(mt,4))=-pl+1theny1=5:goto670
  65. 640 goto690
  66. 650 bc(1,bb(mt,1))=pl:bc(1,bb(mt,2))=pl:p=bb(mt,1)
  67. 660 gosub810:printcr$:p=bb(mt,2):gosub810:printcr$:goto620
  68. 670 bc(1,bb(mt,3))=pl:bc(1,bb(mt,4))=pl:p=bb(mt,3)
  69. 680 gosub810:printcr$:p=bb(mt,4):gosub810:printcr$
  70. 690 p=an(2,mt):pp=p:kt=1:gosub800:yr=r2:bc(2,p)=pl:tm=p:ifbb(tm,1)=0then710
  71. 700 ifbc(2,bb(tm,1))=-pl+1andbc(2,bb(tm,2))=-pl+1then740
  72. 710 ifbb(tm,3)=0then780
  73. 720 ifbc(2,bb(tm,3))=-pl+1andbc(2,bb(tm,4))=-pl+1then760
  74. 730 goto780
  75. 740 bc(2,bb(tm,1))=pl:bc(2,bb(tm,2))=pl:p=bb(tm,1):kt=1
  76. 750 gosub810:printcr$:p=bb(tm,2):kt=1:gosub810:print cr$:goto710
  77. 760 bc(2,bb(tm,3))=pl:bc(2,bb(tm,4))=pl:p=bb(tm,3):kt=1
  78. 770 gosub810:printcr$:p=bb(tm,4):kt=1:gosub810:printcr$
  79. 780 gosub1460:pl=-pl+1:turn=turn+1:ifturn=25then70
  80. 790 goto560
  81. 800 gosub810:printcr$:return
  82. 810 poke646,cl(pl):ifp<6thenck=1:kc=1:goto860
  83. 820 ifp<11thenck=2:kc=4:goto860
  84. 830 ifp<16thenck=3:kc=7:goto860
  85. 840 ifp<21thenck=4:kc=10:goto860
  86. 850 ck=5:kc=13
  87. 860 ifktthentemp=5*ck-p:xx=(38-te*3)-3:yy=y1+kc:gosub880:kt=0:r2=ck:return
  88. 870 temp=5*ck-p:xx=(24-te*3)-9:yy=y1+kc:gosub880:r1=ck:return
  89. 880 poke783,0:poke781,yy:poke782,xx:sys65520:return
  90. 890 jy=15-(peek(56320+pl*f2)and15):jb=peek(56320+pl*f2)and16
  91. 900 ifjb=0thenreturn
  92. 910 ifjy=8thenjy=3
  93. 920 ifjy<1orjy>4then890
  94. 930 onjygoto940,960,980,1000
  95. 940 ifqx-4<upthen890
  96. 950 qx=qx-24:mt=mt-5:gosub1020:goto890
  97. 960 ifqx+4>dnthen890
  98. 970 qx=qx+24:mt=mt+5:gosub1020:goto890
  99. 980 ifqy+4>rmthen890
  100. 990 qy=qy+24:mt=mt+1:gosub1020:goto890
  101. 1000 ifqy-4<lmthen890
  102. 1010 qy=qy-24:mt=mt-1:gosub1020:goto890
  103. 1020 poketv+4,qy:poketv+5,qx:return
  104. 1030 data "01","02","03","04","05","06","07","08","09"
  105. 1040 data255,255,252,192,0,12,192,0
  106. 1050 data12,192,0,12,192,0,12,192
  107. 1060 data0,12,192,0,12,192,0,12
  108. 1070 data192,0,12,192,0,12,255,255
  109. 1080 data252,0,0,0,0,0,0,0
  110. 1090 data0,0,0,0,0,0,0,0
  111. 1100 data0,0,0,0,0,0,0,0
  112. 1110 data0,0,0,0,0,0,0
  113. 1120 data 0,0,0,0,60,102,102,110
  114. 1130 data 0,0,0,0,24,24,56,24
  115. 1140 data 0,0,0,0,60,102,6,12
  116. 1150 data 0,0,0,0,60,102,6,28
  117. 1160 data 0,0,0,0,6,14,30,54
  118. 1170 data 0,0,0,0,126,96,96,124
  119. 1180 data 0,0,0,0,60,102,96,96
  120. 1190 data 0,0,0,0,126,102,12,24
  121. 1200 data 0,0,0,0,60,102,102,60
  122. 1210 data 0,0,0,0,60,102,102,102
  123. 1220 data 118,102,102,60,0,0,0,0
  124. 1230 data 24,24,24,126,0,0,0,0
  125. 1240 data 12,48,96,126,0,0,0,0
  126. 1250 data 28,6,102,60,0,0,0,0
  127. 1260 data 102,127,6,6,0,0,0,0
  128. 1270 data 6,6,102,60,0,0,0,0
  129. 1280 data 124,102,102,60,0,0,0,0
  130. 1290 data 24,24,24,24,0,0,0,0
  131. 1300 data 60,102,102,60,0,0,0,0
  132. 1310 data 62,6,102,60,0,0,0,0
  133. 1320 data 0,7,31,63,127,127,255,255
  134. 1330 data 0,224,248,252,254,254,255,255
  135. 1340 data 255,255,127,127,63,31,7,0
  136. 1350 data 255,255,254,254,252,248,224,0
  137. 1360 data 2,3,3,3,2
  138. 1370 data 3,4,4,4,3
  139. 1380 data 3,4,4,4,3
  140. 1390 data 3,4,4,4,3
  141. 1400 data 2,3,3,3,2
  142. 1410 data 2,6,0,0,1,3,0,0,2,4,0,0,3,5,0,0,4,10,0,0
  143. 1420 data 1,11,0,0,6,8,2,12,7,9,3,13,8,10,4,14,5,15,0,0
  144. 1430 data 6,16,0,0,11,13,7,17,12,14,8,18,13,15,9,19,10,20,0,0
  145. 1440 data 11,21,0,0,16,18,12,22,17,19,13,23,18,20,14,24,15,25,0,0
  146. 1450 data 16,22,0,0,21,23,0,0,22,24,0,0,23,25,0,0,20,24,0,0
  147. 1460 ford=1to2
  148. 1470 jj=0
  149. 1480 fori=1to5:gosub1530:nexti:gosub1560
  150. 1490 fori=6to10:gosub1530:nexti:gosub1560
  151. 1500 fori=11to15:gosub1530:nexti:gosub1560
  152. 1510 fori=16to20:gosub1530:nexti:gosub1560
  153. 1520 fori=21to25:gosub1530:nexti:gosub1560:nextd:goto1580
  154. 1530 ifbc(d,i)=2thenjj=jj+15:goto1550
  155. 1540 jj=jj+bc(d,i)
  156. 1550 return
  157. 1560 ifjj/5=plthen80
  158. 1570 jj=0:return
  159. 1580 ford=1to2
  160. 1590 jj=0
  161. 1600 fori=1to21step5:gosub1650:nexti:gosub1680
  162. 1610 fori=2to22step5:gosub1650:nexti:gosub1680
  163. 1620 fori=3to23step5:gosub1650:nexti:gosub1680
  164. 1630 fori=4to24step5:gosub1650:nexti:gosub1680
  165. 1640 fori=5to25step5:gosub1650:nexti:gosub1680:nextd:goto1700
  166. 1650 ifbc(d,i)=2thenjj=jj+15:goto1670
  167. 1660 jj=jj+bc(d,i)
  168. 1670 return
  169. 1680 ifjj/5=plthen80
  170. 1690 jj=0:return
  171. 1700 ford=1to2
  172. 1710 ifbc(d,1)=plandbc(d,7)=plandbc(d,13)=plandbc(d,19)=plandbc(d,25)=plthen80
  173. 1720 ifbc(d,5)=plandbc(d,9)=plandbc(d,13)=plandbc(d,17)=plandbc(d,21)=plthen80
  174. 1730 x=(yr*5)-4:c1=pp-((yr*5)-4)+1:jj=0:i=x:next d:return
  175. 1740 poke53252,0:poke53253,0:return
  176.